package demo4;

public class Computer {
   public  void OpenComputer(){
       System.out.println("开机");
   }
    public  void CloseComputer(){
        System.out.println("关机");
    }
    public void Use(Usb usb){
       usb.OpenDevise();
       if (usb instanceof mouse){
          mouse m = (mouse) usb;
          m.chilk();
       } else if (usb instanceof keyboard) {
           keyboard keyboard = (keyboard)usb;
           keyboard.pr();
       }
       usb.CloseDevise();
    }
}
